#pragma once

namespace AGE
{ 
    /**
     * @brief Provides notications for keyboard input
     * @author Andrew Caci
     * @date November 1, 2009
     *
     * Keyboard notifications such as key down / key up
     *
     */
    class IKeyboardNotification
    {
		friend class GameEngine;

    public:

        virtual ~IKeyboardNotification() {}

        /**
         * @brief When a key is pushed 
         *
         * @param iKey The SDLK which is pushed
         */
        virtual void OnKeyDown( SDLKey iKey ) = 0;

        /**
         * @brief When a key is released 
         *
         * @param iKey The SDLK which is released
         */
        virtual void OnKeyUp( SDLKey iKey ) = 0;

        /**
         * @brief Determines whether or not a key is down
         * 
         * @param iKey The key to test if it is down
         */
        inline bool IsKeyDown( SDLKey iKey ) const
        {
            return m_pKeys[iKey] != 0;
        }

        /**
         * @brief Determines whether or not a key is up
         * 
         * @param iKey The key to test if it is up
         */
        inline bool IsKeyUp( SDLKey iKey )
        {
            return m_pKeys[iKey] == 0;
        }

    private:

		inline void SetKeyState ( Uint8* pKeyState ) 
		{ 
			m_pKeys = pKeyState; 
		}

        Uint8* m_pKeys;
    };
}